#pragma config(Hubs,  S1, HTMotor,  none,     none,     none)
#pragma config(Sensor, S1,     ,               sensorI2CMuxController)
#pragma config(Motor,  motorA,           ,             tmotorNXT, openLoop)
#pragma config(Motor,  motorB,           ,             tmotorNXT, openLoop)
#pragma config(Motor,  motorC,           ,             tmotorNXT, openLoop)
#pragma config(Motor,  mtr_S1_C1_1,     ElevatorLift,  tmotorTetrix, openLoop)
#pragma config(Motor,  mtr_S1_C1_2,     motorE,        tmotorTetrix, openLoop)
//*!!Code automatically generated by 'ROBOTC' configuration wizard               !!*//

#include "JoystickDriver.c"
void initializeRobot ()
{
	motor[ElevatorLift] = 0;
	wait1Msec(1000);
}

void up (int power, int duration)
{
	motor[ElevatorLift]= power;
}

void down (int power, int duration)
{
	motor[ElevatorLift]= power;
}

task main()
{
	initializeRobot();
	while (true)
	{
		getJoystickSettings(joystick);

		if( joystick.joy1_TopHat == 0 )
		{
			up(-30,25);
		}

		if(joystick.joy1_TopHat == 4)
		{
			down(30,25);
		}
	}
}
